\(\int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx\) [1072]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 102 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx=-a^3 x+\frac {3}{2} a b^2 x-\frac {3 a^2 b \text {arctanh}(\cos (c+d x))}{d}+\frac {3 a^2 b \cos (c+d x)}{d}-\frac {b^3 \cos ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \cos (c+d x) \sin (c+d x)}{2 d} \]

[Out]

-a^3*x+3/2*a*b^2*x-3*a^2*b*arctanh(cos(d*x+c))/d+3*a^2*b*cos(d*x+c)/d-1/3*b^3*cos(d*x+c)^3/d-a^3*cot(d*x+c)/d+
3/2*a*b^2*cos(d*x+c)*sin(d*x+c)/d

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {2801, 2715, 8, 2672, 327, 212, 3554, 2645, 30} \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx=-\frac {a^3 \cot (c+d x)}{d}+a^3 (-x)-\frac {3 a^2 b \text {arctanh}(\cos (c+d x))}{d}+\frac {3 a^2 b \cos (c+d x)}{d}+\frac {3 a b^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3}{2} a b^2 x-\frac {b^3 \cos ^3(c+d x)}{3 d} \]

[In]

Int[Cot[c + d*x]^2*(a + b*Sin[c + d*x])^3,x]

[Out]

-(a^3*x) + (3*a*b^2*x)/2 - (3*a^2*b*ArcTanh[Cos[c + d*x]])/d + (3*a^2*b*Cos[c + d*x])/d - (b^3*Cos[c + d*x]^3)
/(3*d) - (a^3*Cot[c + d*x])/d + (3*a*b^2*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2645

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(a*f)^(-1), Subst[
Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2]
 &&  !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 2801

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.), x_Symbol] :> Int[Expan
dIntegrand[(g*Tan[e + f*x])^p, (a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && NeQ[a^2 - b^2
, 0] && IGtQ[m, 0]

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rubi steps \begin{align*} \text {integral}& = \int \left (3 a b^2 \cos ^2(c+d x)+3 a^2 b \cos (c+d x) \cot (c+d x)+a^3 \cot ^2(c+d x)+b^3 \cos ^2(c+d x) \sin (c+d x)\right ) \, dx \\ & = a^3 \int \cot ^2(c+d x) \, dx+\left (3 a^2 b\right ) \int \cos (c+d x) \cot (c+d x) \, dx+\left (3 a b^2\right ) \int \cos ^2(c+d x) \, dx+b^3 \int \cos ^2(c+d x) \sin (c+d x) \, dx \\ & = -\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \cos (c+d x) \sin (c+d x)}{2 d}-a^3 \int 1 \, dx+\frac {1}{2} \left (3 a b^2\right ) \int 1 \, dx-\frac {\left (3 a^2 b\right ) \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}-\frac {b^3 \text {Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d} \\ & = -a^3 x+\frac {3}{2} a b^2 x+\frac {3 a^2 b \cos (c+d x)}{d}-\frac {b^3 \cos ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \cos (c+d x) \sin (c+d x)}{2 d}-\frac {\left (3 a^2 b\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = -a^3 x+\frac {3}{2} a b^2 x-\frac {3 a^2 b \text {arctanh}(\cos (c+d x))}{d}+\frac {3 a^2 b \cos (c+d x)}{d}-\frac {b^3 \cos ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a b^2 \cos (c+d x) \sin (c+d x)}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.86 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.40 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx=\frac {\left (36 a^2 b-3 b^3\right ) \cos (c+d x)-b^3 \cos (3 (c+d x))-6 a^3 \cot \left (\frac {1}{2} (c+d x)\right )+9 a b^2 \sin (2 (c+d x))+6 a \left (-2 a^2 c+3 b^2 c-2 a^2 d x+3 b^2 d x-6 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+6 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+a^2 \tan \left (\frac {1}{2} (c+d x)\right )\right )}{12 d} \]

[In]

Integrate[Cot[c + d*x]^2*(a + b*Sin[c + d*x])^3,x]

[Out]

((36*a^2*b - 3*b^3)*Cos[c + d*x] - b^3*Cos[3*(c + d*x)] - 6*a^3*Cot[(c + d*x)/2] + 9*a*b^2*Sin[2*(c + d*x)] +
6*a*(-2*a^2*c + 3*b^2*c - 2*a^2*d*x + 3*b^2*d*x - 6*a*b*Log[Cos[(c + d*x)/2]] + 6*a*b*Log[Sin[(c + d*x)/2]] +
a^2*Tan[(c + d*x)/2]))/(12*d)

Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.94

method result size
derivativedivides \(\frac {a^{3} \left (-\cot \left (d x +c \right )-d x -c \right )+3 a^{2} b \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {b^{3} \left (\cos ^{3}\left (d x +c \right )\right )}{3}}{d}\) \(96\)
default \(\frac {a^{3} \left (-\cot \left (d x +c \right )-d x -c \right )+3 a^{2} b \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {b^{3} \left (\cos ^{3}\left (d x +c \right )\right )}{3}}{d}\) \(96\)
parallelrisch \(\frac {36 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2} b -12 a^{3} \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+6 \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{3}-\cos \left (3 d x +3 c \right ) b^{3}+9 a \,b^{2} \sin \left (2 d x +2 c \right )+\left (36 a^{2} b -3 b^{3}\right ) \cos \left (d x +c \right )-12 a^{3} d x +18 a \,b^{2} d x +36 a^{2} b -4 b^{3}}{12 d}\) \(134\)
risch \(-a^{3} x +\frac {3 a \,b^{2} x}{2}-\frac {3 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}+\frac {3 b \,{\mathrm e}^{i \left (d x +c \right )} a^{2}}{2 d}-\frac {b^{3} {\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {3 b \,{\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 d}-\frac {b^{3} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {3 i a \,b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {2 i a^{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {3 a^{2} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {3 a^{2} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {b^{3} \cos \left (3 d x +3 c \right )}{12 d}\) \(204\)
norman \(\frac {\left (-3 a^{3}+\frac {9}{2} a \,b^{2}\right ) x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-3 a^{3}+\frac {9}{2} a \,b^{2}\right ) x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-a^{3}+\frac {3}{2} a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-a^{3}+\frac {3}{2} a \,b^{2}\right ) x \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (6 a^{2} b -2 b^{3}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {a \left (a^{2}-3 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{3}}{2 d}+\frac {a^{3} \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {12 a^{2} b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (18 a^{2} b -2 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3 d}-\frac {a \left (a^{2}-3 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {3 a^{2} b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(298\)

[In]

int(cos(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^3*(-cot(d*x+c)-d*x-c)+3*a^2*b*(cos(d*x+c)+ln(csc(d*x+c)-cot(d*x+c)))+3*a*b^2*(1/2*cos(d*x+c)*sin(d*x+c)
+1/2*d*x+1/2*c)-1/3*b^3*cos(d*x+c)^3)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.40 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx=-\frac {9 \, a b^{2} \cos \left (d x + c\right )^{3} + 9 \, a^{2} b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 9 \, a^{2} b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right ) + {\left (2 \, b^{3} \cos \left (d x + c\right )^{3} - 18 \, a^{2} b \cos \left (d x + c\right ) + 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} d x\right )} \sin \left (d x + c\right )}{6 \, d \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^3,x, algorithm="fricas")

[Out]

-1/6*(9*a*b^2*cos(d*x + c)^3 + 9*a^2*b*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 9*a^2*b*log(-1/2*cos(d*x + c
) + 1/2)*sin(d*x + c) + 3*(2*a^3 - 3*a*b^2)*cos(d*x + c) + (2*b^3*cos(d*x + c)^3 - 18*a^2*b*cos(d*x + c) + 3*(
2*a^3 - 3*a*b^2)*d*x)*sin(d*x + c))/(d*sin(d*x + c))

Sympy [F]

\[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{3} \cos ^{2}{\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx \]

[In]

integrate(cos(d*x+c)**2*csc(d*x+c)**2*(a+b*sin(d*x+c))**3,x)

[Out]

Integral((a + b*sin(c + d*x))**3*cos(c + d*x)**2*csc(c + d*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.44 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.93 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx=-\frac {4 \, b^{3} \cos \left (d x + c\right )^{3} + 12 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{3} - 9 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a b^{2} - 18 \, a^{2} b {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{12 \, d} \]

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/12*(4*b^3*cos(d*x + c)^3 + 12*(d*x + c + 1/tan(d*x + c))*a^3 - 9*(2*d*x + 2*c + sin(2*d*x + 2*c))*a*b^2 - 1
8*a^2*b*(2*cos(d*x + c) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (96) = 192\).

Time = 0.37 (sec) , antiderivative size = 199, normalized size of antiderivative = 1.95 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx=\frac {18 \, a^{2} b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, {\left (2 \, a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )} - \frac {3 \, {\left (6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (9 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 18 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 6 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 36 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 18 \, a^{2} b + 2 \, b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^3,x, algorithm="giac")

[Out]

1/6*(18*a^2*b*log(abs(tan(1/2*d*x + 1/2*c))) + 3*a^3*tan(1/2*d*x + 1/2*c) - 3*(2*a^3 - 3*a*b^2)*(d*x + c) - 3*
(6*a^2*b*tan(1/2*d*x + 1/2*c) + a^3)/tan(1/2*d*x + 1/2*c) - 2*(9*a*b^2*tan(1/2*d*x + 1/2*c)^5 - 18*a^2*b*tan(1
/2*d*x + 1/2*c)^4 + 6*b^3*tan(1/2*d*x + 1/2*c)^4 - 36*a^2*b*tan(1/2*d*x + 1/2*c)^2 - 9*a*b^2*tan(1/2*d*x + 1/2
*c) - 18*a^2*b + 2*b^3)/(tan(1/2*d*x + 1/2*c)^2 + 1)^3)/d

Mupad [B] (verification not implemented)

Time = 11.16 (sec) , antiderivative size = 289, normalized size of antiderivative = 2.83 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx=\frac {a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\mathrm {i}\right )\,\left (\frac {a\,b^2\,3{}\mathrm {i}}{2}-a^3\,1{}\mathrm {i}\right )}{d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (12\,a^2\,b-\frac {4\,b^3}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (a^3+6\,a\,b^2\right )-3\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (6\,a\,b^2-3\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (12\,a^2\,b-4\,b^3\right )-a^3+24\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {3\,a^2\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )\,\left (2\,a^2-3\,b^2\right )\,1{}\mathrm {i}}{2\,d} \]

[In]

int((cos(c + d*x)^2*(a + b*sin(c + d*x))^3)/sin(c + d*x)^2,x)

[Out]

(a^3*tan(c/2 + (d*x)/2))/(2*d) - (log(tan(c/2 + (d*x)/2) - 1i)*((a*b^2*3i)/2 - a^3*1i))/d + (tan(c/2 + (d*x)/2
)*(12*a^2*b - (4*b^3)/3) - tan(c/2 + (d*x)/2)^6*(6*a*b^2 + a^3) - 3*a^3*tan(c/2 + (d*x)/2)^4 + tan(c/2 + (d*x)
/2)^2*(6*a*b^2 - 3*a^3) + tan(c/2 + (d*x)/2)^5*(12*a^2*b - 4*b^3) - a^3 + 24*a^2*b*tan(c/2 + (d*x)/2)^3)/(d*(2
*tan(c/2 + (d*x)/2) + 6*tan(c/2 + (d*x)/2)^3 + 6*tan(c/2 + (d*x)/2)^5 + 2*tan(c/2 + (d*x)/2)^7)) + (3*a^2*b*lo
g(tan(c/2 + (d*x)/2)))/d - (a*log(tan(c/2 + (d*x)/2) + 1i)*(2*a^2 - 3*b^2)*1i)/(2*d)